


//
//  SHUserHeaderImgSettingCell.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/5/31.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//

#import "SHUserHeaderImgSettingCell.h"
@interface SHUserHeaderImgSettingCell()
@property(nonatomic,strong)UIImageView *userHeaderImg;
@end
@implementation SHUserHeaderImgSettingCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        
        _userHeaderImg = [[UIImageView alloc]init];
        [_userHeaderImg setCornerRadius:__I6Width(51)/2 bounds:CGRectMake(0, 0, __I6Width(51), __I6Width(51))];

        [self.contentView addSubview:_userHeaderImg ];
        
        
    }
    
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    [self.userHeaderImg  mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(self.contentView.mas_left).with.offset(__I6Width(15));
        make.height.mas_equalTo(__I6Width(51));
        make.width.mas_equalTo(__I6Width(51));
    }];

    
}

- (void)setHeaderImgUrl:(NSString *)headerImgUrl{

    [_userHeaderImg sd_setImageWithURL:[NSURL URLWithString:headerImgUrl] placeholderImage:[UIImage imageNamed:@"humandefault.png"]];
}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
    [super setHighlighted:highlighted animated:animated];
    if (highlighted) {
        self.backgroundColor = KCELLHIGHTLIGHTED;
    }else{
        self.backgroundColor = [UIColor whiteColor];
        
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
    [super setSelected:selected animated:animated];
    
    if (selected) {
        self.backgroundColor = KCELLHIGHTLIGHTED;
    }else{
        self.backgroundColor = [UIColor whiteColor];
        
    }
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
